TARGET := firmware

OBJECT := src/main.o \
          src/slam.o \
          src/camera.o \
          src/location.o \
          src/motion.o \
          src/posinfo.o \
          src/evtinfo.o \
          src/webclient.o \
          src/patrol.o \
          src/dog.o

IFLAGS := -I/usr/local/include/ddscxx \
          -I/usr/local/include/iceoryx/v2.0.2 \
          -I/usr/local/include/unitree \
          -Iinc \
          -I/usr/include/gstreamer-1.0 \
          -I/usr/include/glib-2.0 \
          -I/usr/lib/aarch64-linux-gnu/glib-2.0/include

LFLAGS := -lunitree_sdk2 \
          -lunitree_ros2_idl_cpp \
          -lddsc \
          -lddscxx \
          -lrt \
          -lboost_system \
          -lboost_thread \
          -lboost_program_options \
          -lssl \
          -lcrypto \
          -lpthread \
          -lgstreamer-1.0 \
          -lgobject-2.0 \
          -lglib-2.0

CFLAGS := -std=c++17

src/%.o: src/%.cpp
	g++ -c -o $@ $^ $(IFLAGS) $(CFLAGS)

$(TARGET): $(OBJECT)
	g++ -o $@ $^ $(IFLAGS) $(LFLAGS) $(CFLAGS)

clean:
	rm -rf $(TARGET)
	rm -rf $(OBJECT)
